<%@ page language="java" import="java.util.*"
    pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<form action="">
英语：<input type="text" name="yingyu"><br>
语文：<input type="text" name="yuwen"><br>
数学：<input type="text" name="shuxue"><br>
物理：<input type="text" name="wuli"><br>
化学：<input type="text" name="huaxue"><br>
<button type="submit">提交</button>
</form>
<%
String yingyu=request.getParameter("yingyu");
pageContext.setAttribute("yingyu", yingyu);
String yuwen=request.getParameter("yuwen");
pageContext.setAttribute("yuwen", yuwen);
String shuxue=request.getParameter("shuxue");
pageContext.setAttribute("shuxue", shuxue);
String wuli=request.getParameter("wuli");
pageContext.setAttribute("wuli", wuli);
String huaxue=request.getParameter("huaxue");
pageContext.setAttribute("huaxue", huaxue);
%>
</body>
总分：${yingyu+yuwen+shuxue+wuli+huaxue}<br>
平均分：${(yingyu+yuwen+shuxue+wuli+huaxue)/5}
</html>